/* 
 * File:   VectorROICreator.h
 * Author: Guilherme Monteiro
 *
 */

#ifndef VECTORROISCREATOR_H
#define	VECTORROISCREATOR_H
#include <cstdlib>
#include <cv.h>
#include <highgui.h>
#include <cxcore.h>
#include <exception>
#include <cerrno>
#include <errno.h>

#include "ROI.h"
#include "File.h"
#include "MetaInfo.h"
#include "GenericAdapter.h"
#include "Reader.h"
#include "ImageSaver.h"
#include "TranscriberMetaInfo.h"
#include "NullImageException.h"
#include "CoordinatesInverter.h"

using namespace std;

/**
 * Class responsible to create a
 * vector of ROI's for each page of
 * the book.
 */
class VectorROIsCreator {
public:
    VectorROIsCreator(TranscriberMetaInfo* metaInfo, bool isRotated);
    VectorROIsCreator(const VectorROIsCreator& orig);
    virtual ~VectorROIsCreator();
    
    vector<ROI*> getVectorOfROIs();
    void createROIs();
    
private:
    TranscriberMetaInfo* metaInfo;
    bool isRotated;
    IplImage* highResolutionImage;
    vector<ROI*> rois;
    
    void setHighResolutionImage(string highResolutionImageName) throw (NullImageException);
//    void cutAndSaveLowImage(ROI* r) throw (NullImageException);
};

#endif	/* VECTORROISCREATOR_H */

